% Thomas Bowling
% Finds elements of an array B in the array A.  This function is
% effectively the same as calling find2 on every element in B
% 
% Created: 06/12/2015
% Modified: 

function [I,V,E] = find3(vector,values)
if(min(values) < min(vector) || max(values) > max(vector))
    warning('find3.m: Some values are out of the range of vector');
end


[X, Y] = meshgrid(values,vector);

errors = abs(X-Y);
[E,I] = min(errors);
V = vector(I);

end